package modelkontrol;

import hibernate.HibernatePasienUtil;
import model.TPemeriksaan;

import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.hibernate.Transaction;

public class KontrolPemeriksa {
	public void savePemeriksaan(TPemeriksaan pemeriksaan)
	{
		Session session = HibernatePasienUtil.getSessionFactory().openSession();
		Transaction transaction = null;
		try {
			transaction = session.beginTransaction();
			session.save(pemeriksaan);
			transaction.commit();
		} catch (HibernateException e) {
			transaction.rollback();
			e.printStackTrace();
		} finally {
			session.close();
		}
	}
	
}
